﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EmailDocuments.aspx.cs" Inherits="JMC.CustomActions.EmailDocuments" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <style type="text/css">
        .StandardFormContainer
        {
	        width:500px;
	        margin-left:auto;
	        margin-right:auto;
	        border-bottom:solid 1px #CCCCCC;
	        border-left:solid 1px #CCCCCC;
	        border-right:solid 1px #CCCCCC;
	        clear:both;
	        text-align:center;
        }
        .ButtonFooter
        {
	        float:right;
	        margin:5px 0px 5px 0px;
        }
        .ButtonFooter ul
        {
	        margin:0px;
	        padding:0px;
	        list-style:none;
        }
        .ButtonFooter ul li
        {
	        float:right;
	        margin-left:10px;
        }
        /* Send Correspondance Styles */
        table.EmailForm
        {
	        width:98%;
        }
        table.EmailForm td.Left
        {
	        width:150px;
	        text-align:left;
	        color:#525252;
	        border-top:#d8d8d8 1px solid;
	        padding:5px;

        }
        table.EmailForm td.Right
        {
	        text-align:left;
	        background:#f6f6f6;
  	        border-top:#d8d8d8 1px solid;
  	        padding-bottom:4px;
  	        padding-left:6px;
  	        padding-right:6px;
  	        padding-top:3px;
  	        vertical-align:top;
  	        padding:5px;

        }
        table.EmailForm td.Right input
        {
	        width:250px;
        }
        .BigTextBox
        {
	        width:400px;
        }
        ul.AttachmentsList
        {
	        margin:0px;
	        padding:0px;
        }
        ul.AttachmentsList li
        {
	        margin-bottom:5px;
	        margin-left:10px;
	        padding:0px;
        }
        /* Common */
        .clearer
        {
	        clear:both;
	        display:inline;
        }
        .ms-PartSpacingVertical
        {
	        margin-top:5px;
        }
        span.ConfirmationText
        {
	        color:green;
	        font-weight:bold;
        }
        span.ErrorText
        {
	        color:red;
	        font-weight:bold;

        }
        span.WarningText
        {
	        color:Orange;
	        font-weight:bold;

        }
    </style>
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <div style="padding:5px;text-align:center;">
        <asp:Label ID="lblNoSelectedItems" Text="There are no selected Items" Visible="false" runat="server" />
        <asp:Label ID="lblMessage" runat="server" Visible="false" />
    </div>
    <asp:Panel ID="panForm" runat="server" CssClass="StandardFormContainer">
        <table class="EmailForm" cellpadding="0" cellspacing="0">
            <tr>
                <td class="Left">
                    To:
                </td>
                <td class="Right">
                    <asp:Panel ID="panExternalEmails" runat="server">
                        External email addresses<br />
                        <asp:TextBox ID="txtToAddress" ToolTip="Delimit multiple addresses by putting a ; after each address" runat="server" width="300" />
                    </asp:Panel>
                    <asp:Panel ID="panInternalEmails" runat="server">
                        Internal Users<br />
                        <Sharepoint:PeopleEditor ID="ppUsers" runat="server" MultiSelect="true" AllowEmpty="true" 
                            ErrorMessage="" ValidatorEnabled="true" /><br />
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td class="Left">
                    Subject:
                </td>
                <td class="Right">
                    <asp:TextBox ID="txtSubject" runat="server" width="300" />
                    <asp:RequiredFieldValidator ID="rfvSubject" runat="server" ControlToValidate="txtSubject" EnableClientScript="true" Display="Dynamic" ErrorMessage="Subject Required">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="Left">
                    Body:
                </td>
                <td class="Right">
                    <asp:TextBox ID="txtBody" CssClass="BigTextBox" TextMode="MultiLine" Rows="5" runat="server" />
                    <asp:RequiredFieldValidator ID="rfvBody" runat="server" ControlToValidate="txtBody" EnableClientScript="true" Display="Dynamic" ErrorMessage="Body Required">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="Left">
                    Attachments:
                </td>
                <td class="Right">
                    <asp:Panel ID="phAttachments" runat="server" />

                    <asp:Label ID="lblAttachments" runat="server" />
                </td>
            </tr>
        </table>
        <div class="ButtonFooter">
            <ul>
                <li><asp:Button ID="btnSubmit" runat="server" Text="Send Correspondance" OnClick="SendCorrespondance_Clicked" /></li>
                <li><asp:Button ID="btnClose" runat="server" Text="Close" OnClientClick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Cancel clicked'); return false;"  /></li>
            </ul>
        </div>
    </asp:Panel>
    <%--You can override the default behaviour of using the email address of the outgoing SMTP settings in Central Administration as the From address here --%>
    <asp:HiddenField runat="server" ID="hdnFromAddress" Value=""/>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>
